import 'package:word_game/engine/hero.dart';
import 'package:word_game/battle/battle.dart';

class MKEDSkill extends Skill {
  MKEDSkill() : super('梅开二度');

  @override
  List<Monster> determineTargets(List<Monster> alternatives) {
    if (alternatives == null || alternatives.length == 0) {
      return null;
    }
    if (alternatives.length<=2) {
      return alternatives;
    }

    alternatives.sort((Monster mon1, Monster mon2) => mon1.vitality.compareTo(mon2.vitality));
    return alternatives.sublist(0, 2);
  }

  @override
  AttackAction determineAction(Hero hero) {
    AttackAction action = AttackAction();
    action.attackType = DamageType.physical;
    action.attackNumber = hero.attackPower * 2;
    return action;
  }
  
}